<template>
    <div class="ToastBox" v-show="isShow">
        <div class="ContentBox">
            {{msg}}
        </div>
    </div>
</template>
<script>
export default {
    name:'Toast',
    props:{
    },
    data(){
        return {
            isShow: false,
            msg:'欢迎您使用本系统'
        }
    },
    methods:{
        show(msg,time){
            this.isShow = true
            if(msg){
                this.msg = msg
            }
            if(time){
                setTimeout(()=>{
                    this.isShow = false
                    console.log("Toast隐藏");
                },time)
            }
            
        }
    },
    mounted(){   
    }
}
</script>
<style>
.ToastBox{
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(8, 8, 8, 0.5);
    z-index: 999;
}
.ContentBox{
    position: absolute;
    left: calc(50% - 125px);
    top: 30%;
    background-color: white;
    width: 250px;
    height: 200px;
    border-radius: 20px;
    line-height: 200px;
    text-align: center;
}
</style>